import React, {PureComponent} from 'react';
import {
	Image,
	StyleSheet,
	Text,
	View
} from 'react-native';
import PropTypes from 'prop-types';

/**
 * @FileName: InnerView
 * @Author: mazaiting
 * @Date: 2018/6/14
 * @Description:
 */
class InnerView extends PureComponent {
	static propTypes = {
		iconName: PropTypes.string.isRequired,
		title: PropTypes.string.isRequired
	};
	static defaultProps = {
		iconName: '',
		title: ''
	};
	
	render() {
		return (
			<View style={styles.container}>
				<Image
					style={{width: 30, height: 30}}
					source={{uri: this.props.iconName}}
				/>
				<Text style={{fontSize: 12}}>{this.props.title}</Text>
			</View>
		)
	}
}

/**
 * 样式属性
 */
const styles = StyleSheet.create({
	container: {
		justifyContent: 'center',
		alignItems: 'center',
		height: 60,
		width: 60
	}
});

/**
 * 导出当前Module
 */
module.exports = InnerView;